package com.lanchetech.dao;

import com.lanchetech.bean.request.PageReq;
import com.lanchetech.entity.Lottery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Mapper
public interface LotteryMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Lottery record);

    int insertSelective(Lottery record);

    Lottery selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Lottery record);

    int updateByPrimaryKey(Lottery record);

    List<Lottery> findAllPage(PageReq req);

    int updateDeletedById(@Param("updatedDeleted") Byte updatedDeleted, @Param("id") Long id);

    Lottery findOneByStatusAndDeletedAndType(@Param("status") Byte status, @Param("deleted") Byte deleted, @Param("type") Byte type, @Param("now") Date now);

    int addOneJoinCountById(@Param("id") Long id);

    int updateCoinAmountById(@Param("updatedCoinAmount")BigDecimal updatedCoinAmount,@Param("id")Long id);

    int updatePointAmountById(@Param("updatedPointAmount")BigDecimal updatedPointAmount,@Param("id")Long id);

    List<Lottery> findAllByIds(@Param("ids")List<Long> ids);

    void updateCoinInventory(Long id, BigDecimal prizeAmount);

    void updatePointInventory(Long id, BigDecimal prizeAmount);
}